package cn.bugstack.mybatis.session;

import java.sql.SQLException;
import java.util.List;

/**
 * The primary Java interface for working with Mybatis.
 * Through this interface you can execute commands, get mappers and manage transaction.
 */
public interface SqlSession {


    <T> T selectOne(String statement) throws Exception;


    <E> List<E> selectList(String statement, Object parameter) throws Exception;

    <T> T selectOne(String statement, Object parameter) throws Exception;


    int update(String statement, Object parameter) throws Exception;

    int insert(String statement, Object parameter) throws Exception;

    Object delete(String statement, Object parameter) throws Exception;

    <T> T getMapper(Class<T> type);



    Configuration getConfiguration();

    void commit();

    void close();
}
